package com.ice.work.moment.crawler.dao.position.institutional;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ice.work.moment.facade.crawler.model.InstitutionalPosition;
import org.springframework.stereotype.Repository;

/**
 * @Description Comment dao
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Repository
public class InstitutionalPositionRepository extends ServiceImpl<IInstitutionalPositionMapper, InstitutionalPosition> implements IInstitutionalPositionRepository {


    @Override
    public InstitutionalPosition findByInstitutionalPositionTypeIdAndStockIdAndCloseAtDataStatus(InstitutionalPosition institutionalPosition) {
        return this.baseMapper.selectOne(new QueryWrapper<InstitutionalPosition>().lambda().eq(InstitutionalPosition::getPositionTypeId, institutionalPosition.getPositionTypeId())
                .eq(InstitutionalPosition::getShareId, institutionalPosition.getShareId())
                .eq(InstitutionalPosition::getCloseAt,institutionalPosition.getCloseAt()).eq(InstitutionalPosition::getDataStatus, institutionalPosition.getDataStatus()));
    }


}


